package bytestream;
import java.io.FileOutputStream;
import java.io.IOException;
public class J_WriteFile
{
    public static void main(String args[ ])
    {
        String s = "文件输出流例程";
        byte[ ] b = s.getBytes( );
        FileOutputStream f=null;
        try
        {
            f = new FileOutputStream("out.txt");
            f.write(b);
            f.flush( );
           
        }
        catch (IOException e)
        {
            System.err.println("发生异常:" + e);
            e.printStackTrace( );
        } // try-catch结构结束
        finally
        {
            try{ f.close();}
              catch(IOException e)  {  e.printStackTrace( ); }
        }
    } // 方法main结束
} // 类J_WriteFile结束
